package com.crm.pojo.common;

import lombok.Data;

import java.util.List;

@Data
public class PageResult<T,K> {
    private Long total;
    private List<T> rows;
    private Integer code;
    private String msg;
    private K params;

    public static <T,K> PageResult<T,K> success(List<T> rows){
        PageResult<T,K> pageResult = new PageResult<>();
        pageResult.setCode(200);
        pageResult.setMsg("查询成功");
        pageResult.setRows(rows);
        pageResult.setTotal((long) rows.size());
        return pageResult;
    }
}
